home *** CD-ROM | disk | FTP | other *** search
- ;-------------------------------------------------------------------------
-
- ; H G C . C O M
-
- ;-------------------------------------------------------------------------
- ;
- ; 4/1/86 NF Version 1.0. This program substitutes for Hercules program
- ; of same name, but does not include "SAVE" command.
- ; Use as follows:
- ; "HGC DIAG" or "HGC DI" to enter diagnostic mode
- ; "HGC FULL" or "HGC FU" to enter full memory mode
- ; "HGC HALF" or "HGC HA" to enter half memory mode
- ; Note upper or lower case is permissible.
-
- ;-------------------------------------------------------------------------
-
-
- herc_io equ 03bfh ; i/o port hercules memory select
-
- ;-------------------------------------------------------------------------
- assume CS:code, DS:code
-
- code segment
-
- org 80h
- command_length db (?)
- command_array label byte
-
- org 100h
-
- start: jmp go
-
- epson_id db "Epson version 1.0",0dh,0ah
-
-
- go: push cs
- pop ds
-
- ; for each character in command array, translate to lower case:
-
- xor ch, ch
- mov cl, [command_length]
- jcxz abort
- mov si, offset command_array
-
- next: mov al, [si]
- cmp al, "A"
- jb not_upper
- cmp al, "Z"
- ja not_upper
- add al, 20h
-
- not_upper: mov [si], al
- inc si
- loop next
-
- ; for each character pair in command array, check for command:
-
- xor ch, ch
- mov cl, [command_length]
- jcxz abort
- mov si, offset command_array
-
- next_char: mov ax, [si]
-
- ; Compare command first two letters only.
- ; Note that string operator "xy" orders bytes as y low, x high.
-
- cmp ax, "id" ; "diag"
- jz diag_mode
-
- cmp ax, "uf" ; "full"
- jz full_mode
-
- cmp ax, "ah" ; "half"
- jz half_mode
-
- ; next character
- inc si
- loop next_char
- jmp abort
-
- ; output to port
-
- diag_mode: mov al,0
- jmp output
- full_mode: mov al, 3
- jmp output
- half_mode: mov al, 1
- output: mov dx, herc_io
- out dx, al
-
- abort:
- mov ah, 4ch
- int 21h ; terminate with normal exit
-
- code ends
- end start